package group.sicher.common.entity;

import group.sicher.common.constant.senum.DeliveryTypeEnum;
import group.sicher.common.constant.senum.ShopStatusEnum;
import group.sicher.common.constant.senum.StatusEnum;

import javax.persistence.*;
import java.util.Objects;

/**
 * @Auth rock
 * @Date 2019/7/1 21:08
 * @description
 */
@Entity
@Table(name = "wm_shop")
public class ShopEntity {

    private Long id;
    private Long userId;
    private String shopCode;
    private String shopName;
    private String shortName;
    private ShopStatusEnum status;
    private Long salesmanId;
    private String salesmanName;
    private Long agentId;
    private String agentName;
    private Long companyId;
    private StatusEnum auto;//是否自动接单
    private StatusEnum newOrderNotice;//是否新订单通知
    private DeliveryTypeEnum driverType;//配送类型
    private String signRate;
    private Byte noticeCount;
    private String promiseTime;
    private Long createAt;

       @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id", nullable = false)
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "shop_code", nullable = false, length = 60)
    public String getShopCode() {
        return shopCode;
    }

    public void setShopCode(String shopCode) {
        this.shopCode = shopCode;
    }

    @Basic
    @Column(name = "shop_name", nullable = true, length = 60)
    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    @Basic
    @Column(name = "short_name", nullable = true, length = 60)
    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    @Basic
    @Column(name = "status", nullable = false)
    public ShopStatusEnum getStatus() {
        return status;
    }

    public void setStatus(ShopStatusEnum status) {
        this.status = status;
    }

    @Basic
    @Column(name = "salesman_id", nullable = false)
    public Long getSalesmanId() {
        return salesmanId;
    }

    public void setSalesmanId(Long salesmanId) {
        this.salesmanId = salesmanId;
    }

    @Basic
    @Column(name = "salesman_name", nullable = true, length = 20)
    public String getSalesmanName() {
        return salesmanName;
    }

    public void setSalesmanName(String salesmanName) {
        this.salesmanName = salesmanName;
    }

    @Basic
    @Column(name = "agent_id", nullable = true)
    public Long getAgentId() {
        return agentId;
    }

    public void setAgentId(Long agentId) {
        this.agentId = agentId;
    }

    @Basic
    @Column(name = "agent_name", nullable = true, length = 255)
    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    @Basic
    @Column(name = "company_id", nullable = false)
    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    @Basic
    @Column(name = "auto", nullable = false)
    public StatusEnum getAuto() {
        return auto;
    }

    public void setAuto(StatusEnum auto) {
        this.auto = auto;
    }

    @Basic
    @Column(name = "new_order_notice", nullable = false)
    public StatusEnum getNewOrderNotice() {
        return newOrderNotice;
    }

    public void setNewOrderNotice(StatusEnum newOrderNotice) {
        this.newOrderNotice = newOrderNotice;
    }

    @Basic
    @Column(name = "driver_type", nullable = true)
    public DeliveryTypeEnum getDriverType() {
        return driverType;
    }

    public void setDriverType(DeliveryTypeEnum driverType) {
        this.driverType = driverType;
    }

    @Basic
    @Column(name = "sign_rate", nullable = true, length = 20)
    public String getSignRate() {
        return signRate;
    }

    public void setSignRate(String signRate) {
        this.signRate = signRate;
    }

    @Basic
    @Column(name = "notice_count", nullable = true)
    public Byte getNoticeCount() {
        return noticeCount;
    }

    public void setNoticeCount(Byte noticeCount) {
        this.noticeCount = noticeCount;
    }

    @Basic
    @Column(name = "promise_time", nullable = true, length = 20)
    public String getPromiseTime() {
        return promiseTime;
    }

    public void setPromiseTime(String promiseTime) {
        this.promiseTime = promiseTime;
    }

    @Basic
    @Column(name = "create_at", nullable = true)
    public Long getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Long createAt) {
        this.createAt = createAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ShopEntity that = (ShopEntity) o;
        return id == that.id &&
                userId == that.userId &&
                status == that.status &&
                salesmanId == that.salesmanId &&
                companyId == that.companyId &&
                auto == that.auto &&
                newOrderNotice == that.newOrderNotice &&
                Objects.equals(shopCode, that.shopCode) &&
                Objects.equals(shopName, that.shopName) &&
                Objects.equals(shortName, that.shortName) &&
                Objects.equals(salesmanName, that.salesmanName) &&
                Objects.equals(agentId, that.agentId) &&
                Objects.equals(agentName, that.agentName) &&
                Objects.equals(driverType, that.driverType) &&
                Objects.equals(signRate, that.signRate) &&
                Objects.equals(noticeCount, that.noticeCount) &&
                Objects.equals(promiseTime, that.promiseTime) &&
                Objects.equals(createAt, that.createAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, shopCode, shopName, shortName, status, salesmanId, salesmanName, agentId, agentName, companyId, auto, newOrderNotice, driverType, signRate, noticeCount, promiseTime, createAt);
    }
}
